Perhaps conversion from strings to codes in Prolog, a technique to save memory, should be algorithm, not interpreter-side.